﻿<html>
<head>
    <meta charset="utf-8"/>
    <meta name="viewport" content="width=device-width,initial-scale=1"/>
    <title>个人中心 - 橘子财税，办税不累</title>
    <link rel="shortcut icon" href="static/images/logo.jpg" type="image/x-icon"/>
    <link href="./static/css/app.aa50d7a1e10eaca07f2a864238d3577a.css" rel="stylesheet"/>
    <script type="text/javascript" src="static/js/vue.js"></script>
    <script type="text/javascript" src="static/js/axios.min.js"></script>
    <link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
    <!-- 引入组件库 -->
    <script src="https://unpkg.com/element-ui/lib/index.js"></script>
    <style>
        .hover-list{
            display: block;
            color: #666;
        }
        .hover-list:hover{
            cursor: pointer;
            color: #72b1ff;
        }
        .el-table{
            color: #999;
        }
    </style>
</head>
<body>
<div id="app">
    <div id="header">
        <div class="header">
            <a href="http://www.caishuib.com">
                <img src="static/images/logo.jpg" alt="橘子财税" class="logo">
            </a>
            <ul class="menu">
                <li class=""><a href="people.html" style="color: #fff;display: block;height: 100%;width: 100%;">首页</a> <img
                        src=""
                        class="triangle-tips"/></li>
                <li class=""> <a href="changePass.html" style="color: #fff;display: block;height: 100%;width: 100%;">账户设置</a>  <img
                        src=""
                        class="triangle-tips"/></li>
            </ul>
            <a href="http://xiaopengbest.cn/index.html" class="toindex">叮叮财税首页</a>
            <a class="outlogin" @click="loginOut">退出登录</a>
        </div>
    </div>
    <div id="body">
        <div>
            <div class="Sidebar">
                <div class="content">
                    <p class="title">账号管理</p>
                    <div>
                        <a href="people.html" class="">个人资料</a>
                    </div>
                    <div>
                        <a href="changePass.html" class="">密码修改</a>
                    </div>
                </div>
                <div class="content">
                    <p class="title">收藏记录</p>
                    <div>
                        <a href="shouCang.html" class="">我的收藏</a>
                    </div>
                </div>
                <div class="content">
                    <p class="title">历史记录</p>
                    <div>
                        <a href="home.html" class="router-link-exact-active router-link-active">咨询记录</a>
                    </div>
                    <div>
                        <a href="keChengJiLu.html" >课程记录</a>
                    </div>
                </div>
            </div>
            <div id="main">
                <div id="title">
                    <span class="title">咨询记录</span>
                </div>
                <div id="content">
                    <div class="comment">
                        <el-table
                                @row-click="rowClick"
                                :data="contentData"
                                style="width: 100%">
                            <el-table-column
                                    prop="history.title"
                                    label="标题"
                                    >
                            </el-table-column>
                            <el-table-column
                                    prop="history.brief_info"
                                    label="简介"
                                   >
                            </el-table-column>
                            <el-table-column
                                    prop="created_at"
                                    label="浏览时间"
                            width="200">
                            </el-table-column>
                        </el-table>
                        <div class="pagination-box">
                            <el-pagination
                                    background
                                    @current-change="handleCurrentChange"
                                    :current-page="pageInfo.current_page"
                                    :page-size="pageInfo.per_page"
                                    layout="total, prev, pager, next, jumper"
                                    :total="pageInfo.total">
                            </el-pagination>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<script src="https://hm.baidu.com/hm.js?a71c3d484b2419b0d94468789f7f49e1"></script>
<script type="text/javascript">var _hmt = _hmt || [];
(function () {
    var hm = document.createElement("script");
    hm.src = "https://hm.baidu.com/hm.js?a71c3d484b2419b0d94468789f7f49e1";
    var s = document.getElementsByTagName("script")[0];
    s.parentNode.insertBefore(hm, s);
})();</script>

</body>
<script type="text/javascript">
    new Vue({
        el: '#app',
        data: {
            pageInfo: {
                per_page: 6,
                total: 0,
                current_page: 1
            },
            contentData: [],
            token: '',
            userPhone: '',
            userInfo: {},
            keHttp: 'http://xiaopengbest.cn/api/user/history',
        },
        watch: {
            loginDialogVisible: function (val) {
                if (!val) {
                    Object.keys(this.form).forEach(key => this.form[key] = '');
                    this.$refs['form'].resetFields();
                }
            },
            isLogin: function (val) {
                if (val) {
                    this.title = '登录';
                } else {
                    this.title = '注册';
                }
            }
        },
        created() {
            this.token = localStorage.getItem('token');
            if(this.token){
                this.token =(this.token.replace('"',''));
            }
            this.userPhone = localStorage.getItem('userInfo') ? JSON.parse(localStorage.getItem('userInfo')).phone : '';
            this.userInfo = localStorage.getItem('userInfo') ? JSON.parse(localStorage.getItem('userInfo')) : '';
            this.getKCList();
        },
        methods: {
            rowClick(row) {
                // window.location.href = 'http://localhost:63342/vueding/detail.html?id=' + row.id;
                window.location.href = 'http://xiaopengbest.cn/detail.html?id=' + row.id;
            },
            loginOut() {
                localStorage.clear();
                // window.location.href = 'http://localhost:63342/vueding/index.html';
                window.location.href = 'http://xiaopengbest.cn/index.html';
            },
            handleCurrentChange(val) {
                this.pageInfo.current_page = val;
                this.getKCList();
            },
            getKCList() {
                const self = this;
                axios.get(this.keHttp, {
                    params: {
                        pageSize: this.pageInfo.per_page,
                        page: this.pageInfo.current_page
                    },
                    headers: {
                        "Content-Type": "application/x-www-form-urlencoded;charset=utf-8",
                        'Authorization':  'Bearer ' + this.token
                    }
                }).then((res) => {
                    if (res.data.code == 200) {
                        this.contentData = res.data.data;
                        this.pageInfo.total = res.data.meta.total;
                    }
                }).catch((err) => {
                    this.$message.warning(err.response.data.msg || "数据异常，请重试");
                });
            }
        }
    });
</script>
</html>
